- @title = t('admin.settings.heading')

= form_tag batch_administration_settings_path, method: 'put', class: 'form-horizontal' do

  %ul.nav.nav-tabs
    = section_tab(t('admin.settings.name_heading'), :naming, :active)
    = section_tab(t('admin.settings.contact_heading'), :contact)
    = section_tab(t('admin.settings.features_heading'), :features)
    = section_tab(t('admin.settings.sharing_heading'), :sharing)
    = section_tab(t('admin.settings.membership_management_heading'), :membership_management)
    = section_tab(t('admin.settings.locale_heading'), :locale)
    = section_tab(t('admin.settings.formats_heading'), :formats)
    = section_tab(t('admin.settings.theme_heading'), :theme)
    = section_tab(t('admin.settings.privacy_heading'), :privacy)
    = section_tab(t('admin.settings.services_heading'), :services)

  .tab-content
    .tab-pane.active#naming
      .form-group
        = label_tag 'hostname', t('admin.settings.host.name'), class: 'col-sm-2 control-label'
        .col-sm-10
          = text_field_tag 'hostname', Site.current.host, class: 'form-control'
          %span.help-block
            = t('admin.settings.host.description')
      = setting_row('Name', 'Community')
      = setting_row('Name', 'Site')
      .form-group
        .col-sm-offset-2.col-sm-10
          = button_tag t('save_changes'), class: 'btn btn-success'
    .tab-pane#contact
      .callout.callout-info= t('admin.settings.contact_automated_email_about')
      = setting_row('Contact', 'Send Email Changes To')
      = setting_row('Contact', 'Send Updates To')
      = setting_row('Contact', 'Bug Notification Email')
      = setting_row('Contact', 'Send Attendance Submissions To')
      .callout.callout-info= t('admin.settings.contact_community_info_about')
      = setting_row('Contact', 'Community Office Phone')
      = setting_row('Contact', 'Community Address')
      = setting_row('Contact', 'Community Email')
      = setting_row('Contact', 'Tech Support Email')
      .form-group
        .col-sm-offset-2.col-sm-10
          = button_tag t('save_changes'), class: 'btn btn-success'
    .tab-pane#features
      = setting_row('Features', 'Friends')
      = setting_row('Features', 'Groups')
      = setting_row('Features', 'Stream')
      = setting_row('Features', 'Checkin')
      = setting_row('Features', 'Documents')
      = setting_row('Features', 'Business Directory')
      = setting_row('Features', 'Edit Legacy Ids')
      .form-group
        .col-sm-offset-2.col-sm-10
          = button_tag t('save_changes'), class: 'btn btn-success'
    .tab-pane#sharing
      .callout.callout-info= t('admin.settings.sharing_communications_about')
      = setting_row('Features', 'News Page')
      .callout.callout-info= t('admin.settings.sharing_about')
      = setting_row('Features', 'News by Users')
      = setting_row('Features', 'Pictures')
      = setting_row('Features', 'Verses')
      = setting_row('Features', 'Small Group Size', options: small_group_sizes)
      .form-group
        .col-sm-offset-2.col-sm-10
          = button_tag t('save_changes'), class: 'btn btn-success'
    .tab-pane#membership_management
      = setting_row('Features', 'Notify on Photo Change')
      = setting_row('Features', 'Updates Must Be Approved')
      = setting_row('Features', 'Sign Up')
      = setting_row('Features', 'Sign Up Approval Email')
      = setting_row('Features', 'Custom Person Type')
      = setting_row('Features', 'Custom Person Fields')
      = setting_row('System', 'Adult Age', options: (13..21))
      = setting_row('System', 'Suffixes')
      .form-group
        .col-sm-offset-2.col-sm-10
          = button_tag t('save_changes'), class: 'btn btn-success'
    .tab-pane#locale
      = setting_row('System', 'Language', options: ONEBODY_LOCALES.invert, description: t('admin.settings.System.Language.description', url: 'https://github.com/seven1m/onebody/wiki/Translations').html_safe)
      = setting_row('System', 'Bible Translation', options: BIBLE_TRANSLATIONS.invert, description: t('admin.settings.System.Bible Translation.description').html_safe)
      = setting_row('System', 'Time Zone', options: @timezones)
      = setting_row('System', 'Default Country', options: country_options)
      = setting_row('System', 'Map Zoom Level', options: (12..16).to_a)
      .form-group
        .col-sm-offset-2.col-sm-10
          = button_tag t('save_changes'), class: 'btn btn-success'
    .tab-pane#theme
      = setting_row('Appearance', 'Theme', options: options_from_i18n('admin.settings.Appearance.Theme.options'))
      %div.btn-group.col-sm-4.col-sm-offset-2{ id: 'site-colors', 'data-toggle' => 'buttons'}
        %label{ class: 'btn style-blue'}
          %input{ type: 'radio', name: 'site_color', autocomplete: 'off', value: 'skin-blue'}
          %span{ class: 'fa fa-check'}
        %label{ class: 'btn style-yellow'}
          %input{ type: 'radio', name: 'site_color', autocomplete: 'off', value: 'skin-yellow'}
          %span{ class: 'fa fa-check'}
        %label{ class: 'btn style-green'}
          %input{ type: 'radio', name: 'site_color', autocomplete: 'off', value: 'skin-green'}
          %span{ class: 'fa fa-check'}
        %label{ class: 'btn style-purple'}
          %input{ type: 'radio', name: 'site_color', autocomplete: 'off', value: 'skin-purple'}
          %span{ class: 'fa fa-check'}
        %label{ class: 'btn style-red'}
          %input{ type: 'radio', name: 'site_color', autocomplete: 'off', value: 'skin-red'}
          %span{ class: 'fa fa-check'}
        %label{ class: 'btn style-black'}
          %input{ type: 'radio', name: 'site_color', autocomplete: 'off', value: 'skin-black'}
          %span{ class: 'fa fa-check'}
      .btn-group{ id: 'site-shades', 'data-toggle' => 'buttons'}
        %label{ class: 'btn style-light'}
          %input{ type: 'radio', name: 'site_shade', autocomplete: 'off', value: 'light'}
          %span{ class: 'fa fa-check'}
        %label{ class: 'btn style-dark'}
          %input{ type: 'radio', name: 'site_shade', autocomplete: 'off', value: 'dark'}
          %span{ class: 'fa fa-check'}
      %br
      .form-group
        .col-sm-offset-2.col-sm-10
          = button_tag t('save_changes'), class: 'btn btn-success'
    .tab-pane#formats
      .callout.callout-info= t('admin.settings.formats_date_about_html')
      = setting_row('Formats', 'Full Date and Time')
      = setting_row('Formats', 'Date')
      = setting_row('Formats', 'Date Without Year')
      = setting_row('Formats', 'Time')
      .callout.callout-info= t('admin.settings.formats_phone_about')
      = setting_row('Formats', 'Mobile Phone')
      = setting_row('Formats', 'Phone')
      .form-group
        .col-sm-offset-2.col-sm-10
          = button_tag t('save_changes'), class: 'btn btn-success'
    .tab-pane#privacy
      = setting_row('Privacy', 'Allow Picture Comments')
      = setting_row('Privacy', 'Max Sign in Attempts', options: [5, 10, 20, 50])
      = setting_row('Privacy', 'Minimum Password Characters', options: [5, 6, 7, 8, 9, 10])
      = setting_row('Privacy', 'Require Strong Password')
      .callout.callout-info= t('admin.settings.privacy_defaults_about')
      = setting_row('Privacy', 'Share Email by Default',        label: :name)
      = setting_row('Privacy', 'Share Home Phone by Default',   label: :name)
      = setting_row('Privacy', 'Share Mobile Phone by Default', label: :name)
      = setting_row('Privacy', 'Share Work Phone by Default',   label: :name)
      = setting_row('Privacy', 'Share Fax by Default',          label: :name)
      = setting_row('Privacy', 'Share Address by Default',      label: :name)
      = setting_row('Privacy', 'Share Birthday by Default',     label: :name)
      = setting_row('Privacy', 'Share Anniversary by Default',  label: :name)
      .form-group
        .col-sm-offset-2.col-sm-10
          = button_tag t('save_changes'), class: 'btn btn-success'
    .tab-pane#services
      = setting_row('URL', 'Visitor')
      = setting_row('URL', 'News Feed')
      = setting_row('Services', 'Analytics')
      .form-group
        = label_tag 'email_host', t('admin.settings.Email.Host.name'), class: 'col-sm-2 control-label'
        .col-sm-10
          = text_field_tag 'email_host', Site.current.email_host, class: 'form-control'
          %span.help-block
            = t('admin.settings.Email.Host.description')
      .form-group
        .col-sm-offset-2.col-sm-10
          %h3= t('admin.pusher.heading')
          %p= t('admin.pusher.intro_html')
      = setting_row('Pusher', 'App ID')
      = setting_row('Pusher', 'App Key')
      = setting_row('Pusher', 'Secret')
      = setting_row('Pusher', 'API Scheme')
      = setting_row('Pusher', 'API Host')
      = setting_row('Pusher', 'API Port')
      = setting_row('Pusher', 'WS Host')
      = setting_row('Pusher', 'WS Port')
      = setting_row('Pusher', 'WSS Port')
      .form-group
        .col-sm-offset-2.col-sm-10
          %h3= t('admin.facebook.heading')
          %p
            %strong EXPERIMENTAL
            = t('admin.facebook.intro_html')
      = setting_row('Facebook', 'App ID')
      = setting_row('Facebook', 'App Secret')
      .form-group
        .col-sm-offset-2.col-sm-10
          = button_tag t('save_changes'), class: 'btn btn-success'
